<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>AS life</title>
  <link rel="stylesheet" href="./layui/css/layui.css">
  <link rel="stylesheet" href="./css/index.css">
  <script src="./js/common.js"></script>
  <script>

    var timestamp = Date.parse(new Date());
    if (localStorage.outtime <= timestamp) {
      window.localStorage.clear();
    }

    /* window.onload调用*/
    if (localStorage.token == null) {
      window.location = './login.html?unlogin=1';
    }

    window.onload = function () {
      click_uesr();
      check_runner();
      check_demand();
    }

    // 用户信息权限判断a不可点击
    function click_uesr() {
      if (!(localStorage.type >= 90 && localStorage.type <= 99)) {
        var obj = document.getElementById("d1");
        obj.className += ' layui-disabled';
        obj.onclick = function () { return false; }

        obj = document.getElementById("d2");
        obj.className += ' layui-disabled';
        obj.onclick = function () { return false; }

        obj = document.getElementById("d3");
        obj.className += ' layui-disabled';
        obj.onclick = function () { return false; }

        obj = document.getElementById("d4");
        obj.className += ' layui-disabled';
        obj.onclick = function () { return false; }

        obj = document.getElementById("order_audit");
        obj.className += ' layui-disabled';
        obj.onclick = function () { return false; }

        obj = document.getElementById("order_feedback");
        obj.className += ' layui-disabled';
        obj.onclick = function () { return false; }

        obj = document.getElementById("opinion_feedback");
        obj.className += ' layui-disabled';
        obj.onclick = function () { return false; }
      }
    }

    // 审核系统权限判断 20 跑腿审核
    function check_runner() {
      if (localStorage.type == 20) {
        return;
      } else {
        if (localStorage.type >= 90 && localStorage.type <= 99) {
          return;
        }
        obj = document.getElementById("runner_audit");
        obj.className += ' layui-disabled';
        obj.onclick = function () { return false; }
      }
    }

    // 审核系统权限判断 21 需求审核
    function check_demand() {
      if (localStorage.type == 21) {
        return;
      } else {
        if (localStorage.type >= 90 && localStorage.type <= 99) {
          return;
        }
        obj = document.getElementById("demand_audit");
        obj.className += ' layui-disabled';
        obj.onclick = function () { return false; }
      }
    }
  </script>
</head>

<body>
  <div class="layui-layout layui-layout-admin">
    <div class="layui-header">
      <div class="layui-logo layui-hide-xs layui-bg-black">校园跑腿系统</div>
      <!-- 头部区域（可配合layui 已有的水平导航） -->
      <ul class="layui-nav layui-layout-left">
        <!-- 移动端显示 -->
        <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
          <i class="layui-icon layui-icon-spread-left"></i>
        </li>

      </ul>
      <ul class="layui-nav layui-layout-right">
        <li class="layui-nav-item layui-hide layui-show-md-inline-block">
          <a href="javascript:;">
            <img src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg"
              class="layui-nav-img">
            <label id="nick_name">ss</label>
          </a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:void(0);" onclick="js_out_login()">退出登录</a></dd>
          </dl>
        </li>
      </ul>
    </div>

    <div class="layui-side layui-bg-black">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <div class="layui-side-scroll">
        <ul class="layui-nav layui-nav-tree" lay-filter="test">
          <li class="layui-nav-item layui-nav-itemed">
            <a href="javascript:;" disabled='disabled'>用户管理</a>
            <dl class="layui-nav-child">
              <dd><a id="d1" onclick="click_uesr()" href="/pages/users/user.html" target="right">基本用户信息</a></dd>
              <dd><a id="d2" onclick="click_uesr()" href="/pages/users/runner.html" target="right">阿师跑腿者</a></dd>
              <dd><a id="d3" onclick="click_uesr()" href="/pages/users/admin.html" target="right">管理员</a></dd>
              <dd><a id="d4" onclick="click_uesr()" href="/pages/users/illegal.html" target="right">违规用户</a></dd>
            </dl>
          </li>
          <li class="layui-nav-item">
            <a id="runner_audit" onclick="check_runner()" href="/pages/runner_apply/runner.html" target="right">跑腿审核</a>
          </li>
          <li class="layui-nav-item">
            <a id="demand_audit" onclick="check_demand()" href="/pages/demand/demand.html" target="right">需求审核</a>
          </li>
          <li class="layui-nav-item layui-nav-iteme">
            <a href="javascript:;" disabled='disabled'>订单模块</a>
            <dl class="layui-nav-child">
              <dd><a id="d1" onclick="click_uesr()" href="/pages/order/order.html" target="right">订单信息</a></dd>
            </dl>
          </li>
          <li class="layui-nav-item">
            <a id="demand_audit" onclick="check_demand()" href="/pages/demand/sensitive.html" target="right">敏感词管理</a>
          </li>
          <li class="layui-nav-item">
            <a id="demand_audit" onclick="check_demand()" href="/pages/consult/consult.html" target="right">协商处理</a>
          </li>
          <li class="layui-nav-item">
            <a id="opinion_feedback" onclick="click_uesr()" href="/pages/feedBack/feed_back.html" target="right">意见反馈</a>
          </li>
        </ul>
      </div>
    </div>

    <!-- 内容主体区域 -->
    <div class="layui-body">
      <iframe width="100%" scrolling="no" height="100%" name="right"></iframe>
    </div>

    <div class="layui-footer">
      <!-- 底部固定区域 -->
      阿师跑腿 
    </div>
  </div>


  <script src="./layui/layui.js"></script>
  <script>

    // 退出登录
    function js_out_login() {
      window.localStorage.clear();
      window.location = '../../login.html';
    }

    //JS 
    layui.use(['element', 'layer', 'util'], function () {
      var element = layui.element,
        layer = layui.layer,
        util = layui.util,
        $ = layui.$;

      var name = $("#nick_name");
      name[0].innerText = localStorage.name;

      //头部事件
      util.event('lay-header-event', {
        //左侧菜单事件
        menuLeft: function (othis) {
          layer.msg('展开左侧菜单的操作', {
            icon: 0
          });
        },
        menuRight: function () {
          layer.open({
            type: 1,
            content: '<div style="padding: 15px;">处理右侧面板的操作</div>',
            area: ['260px', '100%'],
            offset: 'rt' //右上角
            ,
            anim: 5,
            shadeClose: true
          });
        }
      });

    });
  </script>
</body>

</html>